<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
{insert name="module_cssjs" css="core.css" js="jquery.min.js"}
</head>
{literal}
<script type="text/javascript">
$(document).ready(function() {
$('[name="del"]').click(function() {
	var $this = this;
	var cid = $(this).parents('tr').attr('node-id');
	if(!cid) {
		alert('缺少参数');return ;
	}
	if(!confirm('您确定删除此分类吗？'))return ;
	
	var params = {'cid': cid};
	$.post('/yunying/product/category/del.json', params, function(dt) {
		if(dt.status) {
			alert(dt.message);
		} else {
			$($this).parents('tr').remove();
		}
	}, 'json');
});
})
</script>
{/literal}
<body>
<h3 class="label">
	<strong class="on"><span>所有分类</span></strong>
	<strong><span><a href="/yunying/product/category/add">添加分类</a></span></strong>
	<span class="refresh"><a href="">刷新</a></span>
</h3>
<div class="table">
	<table class="TB-list">
		<tr class="TB-header">
			<td width="50">分类ID</td>
			<td width="150">分类名称</td>
			<td width="200">操作</td>
		</tr>
		{foreach item=item key=key from=$product.data name=list}
		<tr {if $smarty.foreach.list.index%2 == 0}class="even"{else}class="odd"{/if} node-id={$item.cid}>
			<td>{$item.cid}</td>
			<td>{$item.name}</td>
			<td>[<a href="/yunying/product/category/edit?cid={$item.cid}">编辑</a>] [<a href="javascript:void(0);" name="del">删除</a>]</td>
		</tr>
		{/foreach}
	</table>
	<div>{insert name="module_page" query=$query size=$product.size num=$product.num page=$product.page}</div>
</div>
</body>
</html>